#include <iostream>
#include <sstream>
#include <usrtctx.hpp>

using namespace usrtos;
using namespace std;
int main(int argc,char *argv[])
{
    CTX ctx(argv[1]);
	int c = 0;
    while(1) {
		usleep(100000);

	    if(strcmp(argv[2],"sys")==0) {
			SYSLOG();
		}
		if(strcmp(argv[2],"debug")==0) {
			DEBUG();
		}
		if(strcmp(argv[2],"info")==0) {
			// usrtlog *log = INFO.getLog();
			// logtrigger *ptrigger = log->m_ptrigger;
			// cout << hex;
			// cout << " mask:" << INFO.getLog()->m_ptrigger->mask;
			// cout << " set:"  << INFO.getLog()->m_ptrigger->set;
			// cout << dec << endl;
			INFO();
		}
		if(strcmp(argv[2],"warn")==0) {
			WARN();
		}
		if(strcmp(argv[2],"error")==0) {
			ERROR();
		}
		if(strcmp(argv[2],"fatal")==0) {
			FATAL();
		}
	
    	if(strcmp(argv[2],"log")==0) {
			usleep(900000);
            SYSLOG("hello world! %d\n",c);
            c++;
        }
    }
}
